from typing import List


def select_sort(in_ls: List) -> List:
    """
    采用选择排序算法对输入数组进行升序排序
    :param in_ls:以列表形式展示的乱序数组
    :return: 以列表形式展示的升序数组
    """
    for i in range(0, len(in_ls)-1):
        cur_min = in_ls[i]
        cur_min_pos = i
        for j in range(i+1, len(in_ls)):
            if in_ls[j] < cur_min:
                cur_min_pos = j
        in_ls[i], in_ls[cur_min_pos] = in_ls[cur_min_pos], in_ls[i]

    out_ls = in_ls.copy()
    # 请补充
    pass
    return out_ls


if __name__ == '__main__':
    # a = [5, 6, 7, 8, 1, 2, 4]
    a = eval(input())
    if isinstance(a, List):
        b = select_sort(a)
        print(b)
    else:
        print("格式错误，请输入数组")
